package cn.rcth.base.serivce.impl;

import cn.rcth.base.domain.VerifyCode;
import cn.rcth.base.mapper.VerifyCodeMapper;
import cn.rcth.base.serivce.IVerifyCodeSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class VerifyCodeSerivceImpl implements IVerifyCodeSerivce {


    @Autowired
    private VerifyCodeMapper verifyCodeMapper;

    @Override
    public VerifyCode getCodeByPhone(String phone) {
        return verifyCodeMapper.getCodeByPhone(phone);

    }

    @Override
    public void save(VerifyCode verifyCode) {
        verifyCodeMapper.insert(verifyCode);
    }

    @Override
    public void deleteCode(Long id) {
        verifyCodeMapper.deleteByPrimaryKey(id);
    }
}
